import React, { Component } from 'react';
import { Modal, Table } from 'antd';
import moment from 'moment';

export default class OrderProcessModal extends Component{
    constructor(props) {
        super(props);
        this.state = {};
        this.columns = [
            { title: '订单id', dataIndex: 'orderId', key: 'orderId' },
            { title: '标题', dataIndex: 'title', key: 'title' },
            { title: '详情', dataIndex: 'content', key: 'content' },
            { 
                title: '时间',
                dataIndex: 'addTime',
                key: 'addTime',
                render(text) {
                    return moment(Number(text) * 1000).format('YYYY-MM-DD HH:mm:ss');
                }
            }
        ]
    }
    render() {
        const { visible, info, handleCancel } = this.props;
        return (
            <Modal
                footer={null}
                width={1000}
                visible={visible}
                onCancel={handleCancel}
                title={'查询订单进度'}>
                <div>
                    <Table
                        columns={this.columns}
                        pagination={false}
                        dataSource={info}
                        pageSize={10}
                        bordered
                    />
                </div>
            </Modal>
        );
    }

}